<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //原型链
        function Car(name,speed) {
            this.name=name;
            this.speed=speed;
        }
        // 1.声明一个变量
        //2.开辟测试空间
        //3.拷贝
        //4.

            Car.prototype.showName=function () {
                console.log(this.name);
            }

            var car=new Car("奥迪",300);
            var car2=new Car("五菱",400);
            console.log(car);
            console.log(car2);

            car.showName();
       
    </script>
</head>
<body>
    
</body>
</html>